﻿using System.Collections.Generic;
using System.Linq;


namespace RaceList.activity.help
{
    /// <summary>
    ///     这里主要是封装了一些数据库中对Activity_Relay,Activity_SubRelay的操作
    /// </summary>
    public partial class RelayQuery
    {
        public static List<Activity_SubRelay> GetSubRelayList(int relayId)
        {
            ipowdb_suibian_webDataContext db = ConnHelper.ipowdb_suibian_web();
            List<Activity_SubRelay> result = db.Activity_SubRelay.Where(s => s.RelayId == relayId).ToList();
            return result;
        }

        public static Activity_SubRelay GetSubRelay(int subRelayId)
        {
            ipowdb_suibian_webDataContext db = ConnHelper.ipowdb_suibian_web();
            Activity_SubRelay result = db.Activity_SubRelay.FirstOrDefault(s => s.Id == subRelayId);
            return result;
        }
    }
}